package com.jerry.template.module.mainpage.shouye.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * Created by chenhuan on 2016/5/11.
 */
public class HomePageFragmentAdapter extends FragmentStatePagerAdapter{

    private List<Fragment> mFragment;
    private static final String[] TITILES={"推荐","视频","图片","段子","精华","同城","游戏"};

    public HomePageFragmentAdapter(FragmentManager fm, List<Fragment> mFragment){
        super(fm);
        this.mFragment = mFragment;
    }

    @Override
    public Fragment getItem(int position){
        return mFragment.get(position);
    }

    @Override
    public int getCount(){
        return  mFragment.size();
    }

    @Override
    public CharSequence getPageTitle(int position){
        return TITILES[position];
    }
}
